home *** CD-ROM | disk | FTP | other *** search
/ MacWarehouse Macintosh Games / MacWarehouse Macintosh Games.iso / AMBER demo / AMBER-Journeys Beyond™ Patch 1c / 00109_Headgear on.ls < prev    next >
Encoding:
Text File  |  1997-02-19  |  1.2 KB  |  36 lines

  1. on mouseDown
  2.   global oStoryteller, oPuppeteer, gFreezeInventory, gOriginPoint
  3.   set currentLoc to getState(oStoryteller, #currentLocation)
  4.   set portalLocations to [#GgazPath_A_up, #Ggaz_B_W_up, #Ggaz_C_S_up, #Ggaz_D_E_up, #Ggaz_E_N_up, #Gbhs_B_E, #MargEntry, #MargPortal_Ewall]
  5.   if getPos(portalLocations, currentLoc) = 0 then
  6.     set hasPortalLoop to 0
  7.   else
  8.     set hasPortalLoop to 1
  9.   end if
  10.   if (getState(oStoryteller, #itemInUse) = #none) and not gFreezeInventory then
  11.     endLoop(#amberHum)
  12.     set the volume of sound 5 to 0
  13.     if getState(oStoryteller, #endGame) = 1 then
  14.       setState(oStoryteller, #AMBERVISION, #off)
  15.       set the loc of sprite 39 to point(-1000, -1000) + gOriginPoint
  16.       puppetSprite(39, 0)
  17.       if hasPortalLoop = 1 then
  18.         killVideo()
  19.       end if
  20.       updateDisplay(oPuppeteer)
  21.       addInventory(#Headgear, #quietly)
  22.       useInventory(#Headgear)
  23.     else
  24.       setState(oStoryteller, #AMBERVISION, #off)
  25.       wait(5)
  26.       set the castNum of sprite 39 to getProp(the lsForegroundData of oPuppeteer, #HeadgearOff)
  27.       if hasPortalLoop = 1 then
  28.         killVideo()
  29.       end if
  30.       updateDisplay(oPuppeteer)
  31.       wait(5)
  32.       addInventory(#Headgear)
  33.     end if
  34.   end if
  35. end
  36.